package com.lazy.utils.mybatis.tk.mapper;

import com.lazy.utils.mybatis.tk.update.UpdateWithOptimisticLockProvider;
import org.apache.ibatis.annotations.UpdateProvider;

/**
 * @author: wql
 * @create_time: 2018-04-24 17:55
 * @describe:
 */
public interface UpdateWithOptimisticLockMapper<T> {

    /**
     * 更新非 NULL字段，用到乐观锁，数据库表中必须有 int型的version字段
     *
     * @param record
     * @return
     */
    @UpdateProvider(type = UpdateWithOptimisticLockProvider.class, method = "dynamicSQL")
    int updateByPrimaryKeySelectiveWithLock(T record);

}
